package com.powergisol.gis.controller;

import com.powergisol.gis.service.SzCoordsService;
import com.powergisol.gis.util.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;

@RestController
@RequestMapping("/coords")
public class SzCoordsController {
    @Autowired
    private SzCoordsService coordsService;

    @RequestMapping(value = "/upload", method = RequestMethod.POST)
    public Result uploadFile(MultipartFile file) {
        return coordsService.uploadFile(file);
    }

    @RequestMapping(value = "/getdata", method = RequestMethod.GET)
    public Result selectData() {
        return coordsService.select();
    }

}
